
# generate figure 5

# load packages
library(rio) # load data
library(tidyverse) # data manipulation
library(ggpubr) # combine different plots

# set working directory
setwd("~/replication_files/")

# call R file that estimates models 
source("05_generate_tab1.R")
# note that you need to change the working directory in the source file as well


plot1 <- plot(fect1, main = "(a) Treatment: Consultation Promotes Natural Resource Governance", 
              ylab = "Effect on the Probability of Policy Passage",
              xlab = "Years Since Treatment Began", cex.main = 0.8, cex.lab = 0.8, 
              cex.axis = 0.8, proportion = 0.05, show.point = TRUE, xlim = c(-2,3), ylim = c(-0.2,0.25)) + theme_classic() +
  theme(plot.title = element_text(face="bold")) 

plot2 <- plot(fect2, main = "(b) Treatment: Consultation Uses Natural Resource Terms", 
              ylab = "Effect on the Probability of Policy Passage", 
              xlab = "Years Since Treatment Began", cex.main = 0.8, cex.lab = 0.8, 
              cex.axis = 0.8, proportion = 0.05, show.point = TRUE, xlim = c(-2,3), ylim = c(-0.2,0.25)) + theme_classic() +
  theme(plot.title = element_text(face="bold"))

ggarrange(plot1,plot2, ncol = 2) %>%
  ggexport(filename = "figures/fig5.pdf", width = 14, height = 5)
